package com.ruoyi.villagers.service.impl;

import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.villagers.domain.VigHouse;
import com.ruoyi.villagers.mapper.VigHouseMapper;
import com.ruoyi.villagers.service.IVigHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VigHouseServiceImpl implements IVigHouseService {
    /**
     * 如果调用其他模块，注入service;
     */
    @Autowired
    private VigHouseMapper vigHouseMapper;


    @Override
    public List<VigHouse> selectHouseList(VigHouse house) {
        return vigHouseMapper.selectHouseList(house);
    }

    @Override
    public int insertHouse(VigHouse house) {
        return vigHouseMapper.insertHouse(house);
    }




    /**
     * 修改保存建房信息
     *
     * @param house 建房信息
     * @return 结果
     */
    @Override
    public int updateHouse(VigHouse house) {
        return vigHouseMapper.updateHouse(house);
    }




    /**
     * 通过建房ID查询建房信息
     *
     * @param houseId 建房ID
     * @return 角色对象信息
     */
    @Override
    public VigHouse selectHouseById(Long houseId) {
        return vigHouseMapper.selectHouseById(houseId);
    }


    /**
     * 删除建房信息
     *
     * @param houseId 建房ID
     * @return 结果
     */
    @Override
    public int deleteHouseById(Long houseId) {
        return vigHouseMapper.deleteHouseById(houseId);
    }


    /**
     * 批量删除建房信息
     *
     * @param houseIds 需要删除的建房ID
     * @return 结果
     * @throws Exception 异常
     */
    @Override
    public int deleteHouseByIds(Long[] houseIds) {

        return vigHouseMapper.deleteHouseByIds(houseIds);
    }

    @Override
    public List<VigHouse> selectHouseAll() {
        return vigHouseMapper.selectHouseAll();
    }

    /**
     * 通过申请
     * @param houseId
     * @return
     */
    @Override
    public int passHouse(Long houseId) {
        return vigHouseMapper.passHouse(houseId);
    }


    /**
     * 批量通过申请
     * @param houseIds
     * @return
     */
    @Override
    public int passHouses(Long[] houseIds) {
        return vigHouseMapper.passHouses(houseIds);
    }


}
